<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			const obj1 = {
				a: 1,
				func: () => console.log(this.a),
			}
			obj1.func() //undefined

			const obj2 = {
				a: 2,
				func: function () {
					console.log(this.a)
				},
			}
			obj2.func() //2

			const obj3 = obj2
			obj3.a = 4
			obj3.func() //4

			obj2.func() //4

			const func1 = obj3.func
			func1() //undefined

			setTimeout(() => {
				obj2.func()
			})
			obj3.a = 9 //9

			//第七
			// obj2.func.call(obj1,'66666')  //undefined 2 4 4 undefined 1  9
			// obj2.func.bind(obj1, '555555')   //undefined 2 4 4 undefined 9
			obj2.func.apply(obj1)  //undefined 2 4 4 undefined 9
		</script>
	</body>
</html>
